<template>
  <div v-if="infoobj">
    <!-- 面包屑 -->
    <breaddetail :category="infoobj.categories" :name="infoobj.name"></breaddetail>
    <!-- 商品基本信息区 -->
    <div class="goods-info">
      <div class="media">
        <goodsImage :imgarr="infoobj.mainPictures"/>
      </div>
      <div class="spec"></div>

    </div>
    <!-- 商品推荐 -->
    <!-- 商品详情 -->
  </div>
</template>

<script>
import { getdetail } from "@/utils/api/homeapi";
import breaddetail from "./BreadView.vue";
import goodsImage from './goodsImage.vue'
export default {
  components: { breaddetail, goodsImage },
  data() {
    return {
      infoobj: {}
    };
  },
  mounted() {
    this.getDetailList(this.$route.query.id)
  },
  methods: {
    async getDetailList(id) {
      let res = await getdetail(id);
      this.infoobj = res.result
      //  console.log(res);
    },
  },
}
</script>

<style lang="scss" scoped>
.basic {
  background: #fff;
}
.goods-info {
  min-height: 600px;
  background: #fff;
  display: flex;
  .media {
    width: 580px;
    height: 600px;
    padding: 30px 50px;
  }
  .spec {
    flex: 1;
    padding: 30px 30px 30px 0;
  }
}
</style>